package com.tencent.inclass;


import org.junit.Test;

import java.util.Random;


public class Practise {

    @Test
    public  void test(){
        int a = 6,b = 8;
        String reuslt = a == b? "相等": String.valueOf(a > b ? a :b);
        System.out.println(reuslt);
    }
    @Test
    public  void test1(){
        int a = -2147483648;
        int abs = Math.abs(a);
        System.out.println(abs);
    }

    @Test
    public void test2(){
        int age =  1;
        if(age > 100 || age<0){
            System.out.println("神仙");
        }else if(age < 100 && age>50){
            System.out.println("老年");
        }else if(age < 50 && age >20){
            System.out.println("中年");
        }else if(age < 20 && age>10){
            System.out.println("青年");
        }else{
            System.out.println("儿童");
        }
    }
    @Test
    public void test3(){

        Random rd = new Random();
        int a = rd.nextInt(100);
        switch(a>80?1:(a<60?2:3)){
            case 1:
                System.out.println("优秀");
                break;
            case 2:
                System.out.println("不及格");
                break;
            case 3:
                System.out.println("及格");
                break;
            default:


        }




    }
    @Test
    public void test4(){
       int a = 69;
        switch(a/20){
            case 5:
            case 4:
                System.out.println("优秀");
                break;
            case 3:
                System.out.println("及格");
                break;
            default:
                System.out.println("不及格");


        }
    }
}
